import bpy;

def show(name, value):
   bpy.ops.object.select_name(name=name)
   bpy.context.object.hide_render = not(value)
   
def showAll(value):
   depths = ["inner", "outer", "fill"]
   sides = ["diagonal", "diagonal2", "diagonal3", "horizontal", "vertical"]
   path = bpy.data.scenes[0].render.filepath
   for depth in depths:
      for side in sides:
         show(depth + "." + side, value)

def _render():
   depths = ["fill", "inner", "outer"]
   sides = ["diagonal", "diagonal2", "diagonal3", "horizontal", "vertical"]
   path = bpy.data.scenes[0].render.filepath
   for depth in depths:
      for side in sides:
         show(depth + "." + side, False)
   for depth in depths:
      for side in sides:
         'Rendering ' + depth + '.' + side + '...'
         show(depth + "." + side, True)
         bpy.context.scene.render.use_compositing = not(bpy.context.object.get('no_lines') == 1)
         orientation = bpy.context.scene.get('orientation')
         if orientation == 'hanging':
            orientation = ',h'
         else:
            orientation = ',t'
            
         orientation = orientation + "," + str(bpy.context.scene.get('tile.width'))   
         orientation = orientation + "," + str(bpy.context.scene.get('tile.height'))   
         strPath = path + orientation + "." + depth + "." + side
         bpy.data.scenes[0].render.filepath = strPath
         bpy.ops.render.render(write_still=True)
         bpy.data.scenes[0].render.filepath = path
         strPath = ""
         show(depth + "." + side, False)
      
_render()
